package cn.wolfcode.web.controller;


import cn.wolfcode.domain.SystemLog;
import cn.wolfcode.qo.LogQueryObject;
import cn.wolfcode.service.ISystemLogService;
import cn.wolfcode.qo.QueryObject;
import cn.wolfcode.util.RequiredPermission;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/systemLog")
public class SystemLogController {

    @Autowired
    private ISystemLogService systemLogService;


    @RequiredPermission(name="系统日志主页",expression="systemLog:saveOrUpdate")
    @RequestMapping("/list")
    public String list(Model model, @ModelAttribute("qo") LogQueryObject qo){
        PageInfo<SystemLog> pageInfo = systemLogService.query(qo);
        model.addAttribute("pageInfo", pageInfo);
        return "log/log";
    }

}
